function FontString(layer, font, size, x, y, w, h) {
	this.layer = layer;
	this.font = font;
	this.size = size;
	this.x = x;
	this.y = y;
	this.w = w;
	this.h = h;
	this.color = "#FFFFFF";
}

FontString.prototype = {
	setText: function (text) {
		this.text = text;
	},
	setColor: function (color) {
		this.color = color;
	},
	draw: function (ctx) {
		if (this.text) {
			ctx.save();
			ctx.font = this.size + "px " + this.font + ", sans-serif";
			ctx.textAlign = "left";
			ctx.textBaseline = "alphabetic";
			ctx.fillStyle = this.color;
			if (this.w) {
				ctx.fillText(this.text, this.x, this.y, this.w);
			} else {
				ctx.fillText(this.text, this.x, this.y);
			}
			ctx.restore();
		}
	},
};

